package oo

import fieldmaskutils "github.com/mennanov/fieldmask-utils"

type FieldMask struct {
	fieldmaskutils.Mask
}

func NewFieldMask(s string) *FieldMask {
	oo := &FieldMask{}
	oo.Mask = fieldmaskutils.MaskFromString(s)
	return oo
}

func (oo FieldMask) Copy(src, dst interface{}) {
	if err := fieldmaskutils.StructToStruct(oo.Mask, src, dst); err != nil {
		panic(err)
	}
}
